<template>
	<!-- 每类列表 -->
	<listScroll class="listScroll" @loadmore="loadmore">
		<slot></slot>
		<!-- 卡片 -->
		<listCard mode="base" v-for="(item,index) in list" :key="item._id" :item="item"></listCard>
		<!-- 加载更多 -->
		<uni-load-more v-if="list.length===0 || list.length>4" iconType="snow" :status="load.loading ||'loading'"></uni-load-more>
	</listScroll>
</template>

<script>
	import listScroll from "@/components/listScroll/listScroll.vue";
	import listCard from "@/components/listCard/listCard.vue";
	
	export default {
		name: "listItem",
		components: {
			listScroll,
			listCard
		},
		props: {
			list: {
				type: Array,
				default () {
					return [];
				}
			},
			load:{
				type:Object,
				default(){
					return {
						loading:"loading"
					}
				}
			}
		},
		data() {
			
			return {

			};
		},
		methods:{
			loadmore(){
				// 传给父组件 List
				this.$emit('loadmore')
			}
		}
	}
</script>

<style lang="scss">
	.listScroll {
		height: 100%;
		display: flex;
	}
</style>
